/*
Package policies
@Author   : Uyynot
@Email    : uyynot@qq.com
@Time     : 2024/4/28 16:09
@File     : topic_policy.go
@Project  : gohub
@Desc     :用户授权
*/
package policies

import (
	"github.com/gin-gonic/gin"
	"gohub/app/models/topic"
	"gohub/pkg/auth"
)

// CanModifyTopic
// @Description: 当前登录用户id是否与topic的创建者id相同
// @param c
// @param _topic
// @return bool
func CanModifyTopic(c *gin.Context, _topic topic.Topic) bool {
	return auth.CurrentUID(c) == _topic.UserID
}
